#include <iostream>
#include <algorithm>
#include<vector>
#include <set>
#include <sstream>
using namespace std;

int main() {

    vector<int> m, n;

    int tmp1, tmp2;

	char ch = 0;
    while (ch != '\n') {
		scanf("%d%d", &tmp1, &tmp2);
		ch = getchar();
        m.push_back(tmp1);
        n.push_back(tmp2);
    }

	if (n[0] == 0) {
		printf("0 0");
		return 0;
	}

    for (int i = 0; i < m.size(); i++) {
        if (n[i] == 0) {
            continue;
        }
        m[i] *= n[i];
        n[i] -= 1;

		printf("%d %d", m[i], n[i]);

		if (m.size() == 1) {
			break;
		}

        if (i < m.size() - 2) {
            printf(" ");
        }
    }

	getchar();


    return 0;
}	